﻿
function initSite() {

//    //热点城市ID查询

//    //加载首页城市介绍数据--需修改调用/Home/HotCity/1，查到
//    initHotCity();

//    initMenu();
//    
//    //加载此方法来保证以后点击功能的实现
//    ClickMenu001();
//    
//    //加载此方法来保证以后点击功能的实现
//    ClickMenu002();
    
    initMap();

    initMarkerManager();
    
//    getShop();

//    startPopupShop();
    
//    // getSearchRaking();

//    $(function() {
//        //选择相应的城市
//        $('#links tr').biggerlink();
//        $('#links1 tr').biggerlink();
//        $('#links2 tr').biggerlink();
//        $('#links3 tr').biggerlink();
//        //小贴士弹出窗口
//        $('#guangdao').cluetip({ sticky: true, closePosition: 'top',
//            closeText: '<img src="../../Content/img/jquery/cross.png" alt="" />'
//        });
//        $('#changqi').cluetip({ width: '200px' })
//        $('a.morecity').cluetip({ width: '200px' })
//        $('#container-1').tabs({ fxFade: true, fxSpeed: 'fast' });
//        $('#container-2').tabs({ fxFade: true, fxSpeed: 'fast' });
//    });
}

//得到推荐城市信息
function initHotCity() {
    //通过JSON得到城市信息
    //grade = 1 是推荐城市，显示在首页； grade=2 是热点城市，显示在“更多。。”的城市列表页面中，参考MoreCityJScript.js 中的initHotCity方法
    $.getJSON('/Home/HotCity/1', { t: new Date() }, function(j) {
    
        var arr = new Array();
        var s = null;
        var jj = 1;
        for (var i = 0; i < j.length; i++) {

            var value = j[i];

            arr = value.split('|');
            //得到城市名
            var HotCityName = arr[0];
            //得到城市ID
            var HotCityID = arr[1];
            var HotCityGrade = arr[2];
            var HotCityLevel = arr[3];
            var HotCityLink = arr[4];
            //得到城市的信息介绍
            var HotCityDescription = arr[5];
            //得到城市的URL
            var HotCityHref = arr[6] + arr[7];
            //对城市信息进行字数控制
            var message = HotCityLink.substring(0, 64);
            
        

                //把相应的数据添加到相应的标签中
                $("#cityName" + jj).html(HotCityName);
                $("#message" + jj).html(message + "...");
                $("#particularMessage" + jj).html(">>>>>>详细信息");
                $("#City" + jj).attr("title", HotCityName + "欢迎您");
                $("#City" + jj).attr("href", '/City/cityDetail/' + HotCityID);
                $("#firstCity" + jj).attr("href", '/City/cityDetail/' + HotCityID);
                $("#img" + jj).attr("src", '/Content/img/CityImg/' + HotCityHref);
                document.getElementById("img" + jj).src = '/Content/img/CityImg/' + HotCityHref;
                jj = jj + 1;
 

        }
        // getinitHotCity();

    });                                // end getJSON

}

//得到热点城市信息
//此方法暂时不用,所以不做注释
function getinitHotCity() {
   // alert('test2');
    $.getJSON('/Home/HotCity/2', { t: new Date() }, function(j) {

        var arr = new Array();
        var s = null;
        if (j.length != 0) {

            var cityNum = parseInt(j.length / 5);

            for (var i = 0; i < cityNum; i++) {
                //alert("test");
                //生成需要的Table
                var tr1 = document.getElementById("MoreCity").insertRow();


                for (var l = cityPage; l < j.length; l++) {

                    if ((cityPage + 1) % 5 != 0) {
                        var value = j[l];

                        arr = value.split('|');

                        var HotCityName = arr[0];
                        var HotCityID = arr[1];
                        var HotCityGrade = arr[2];
                        var HotCityLevel = arr[3];
                        var HotCityLink = arr[4];
                        var HotCityDescription = arr[5];
                        var HotCityHref = arr[6] + arr[7];

                        var td1 = tr1.insertCell();

                        td1.width = "20%";

                        td1.align = "center";

                        td1.innerHTML = "<a class='morecity'  href='/City/CityDetail'" + HotCityID + " title='大阪欢迎您!' rel='/Home/CityAbstract/'" + HotCityID + ">" + HotCityName + "</a>";

                        cityPage = l;
                    }
                    break;

                }

            }
        } else {
            var tr1 = document.getElementById("MoreCity").insertRow();

            var td1 = tr1.insertCell();

            td1.width = "20%";

            td1.align = "center";

            td1.innerHTML = "暂无内容";
        }


    });                       // end getJSON

}

function initMarkerManager() {
    markerManager = new MarkerManager(map);
    markerManager.refresh();
}

function getAddress(overlay, latlng) {
     if (latlng != null) {
        address = latlng;
        geocoder.getLocations(latlng, showAddress);
    }
}

function initMap() {
   // alert('testinitMap');
    if (GBrowserIsCompatible()) {

        var lat = 36.5978891330702;   // zoom to the whole japan 
        var lng = 135.6591796875;
        var scale = 6;

        map = new GMap2(document.getElementById("map_canvas"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.enableDoubleClickZoom();
        map.continuousZoomEnabled();
        map.setCenter(new GLatLng(lat, lng), scale);

        geocoder = new GClientGeocoder();

        if (geocoder) {
            address = "東京都渋谷区千駄ヶ谷5丁目24番2号";
            geocoder.getLatLng(
                              address,
                           function(point) {
                               if (!point) {
                                  // alert(address + " not found");
                               } else {

                                   //map.setCenter(point, 13);
                                   var marker = new GMarker(point);
                                   //map.addOverlay(marker);
                                   //marker.openInfoWindowHtml(address);

                               } //end if 
                           } // end function 
                   );        // end getLatLng 
        }  // end if (geocoder) 


        // Creates a marker at the given point
        // Clicking the marker will hide it
        //首页屏蔽地图搜索功能
       // map.addControl(new google.maps.LocalSearch(), new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(10, 20)));

    } // GBrowserIsCompatible
}


function createShop(latlng, shopMessage, shopID, shopLogo, shopType, shopName, shopCity, shopCategory, lat, lng) {

    var arr = new Array();
    
    var marker = new GMarker(latlng, { icon: getIcon(shopType) });
    marker.value = shopID;

    markerManager.addMarker(marker, 1);
    markerManager.refresh();

    //点击了以后弹出小窗口
    GEvent.addListener(marker, "click", function() {

        var myHtml = "<table align='left' id=''><tr><td align='left' width='260px'>" + shopName + "<img src=" + shopLogo + " height='80px' width='100px' hspace='5' align='left'></img><br/>" + shopMessage + "</td></tr><tr valign='top'><td valign='top' align='left'></td></tr><tr><td><a href = '/City/Trademark/" + marker.value + "?CityID=" + shopCity + "&CategoryID=" + shopCategory + "&Lat=" + lat + "&Lng=" + lng + "'>更多详细信息</a></td></tr></table>";
        map.openInfoWindowHtml(latlng, myHtml);

        stopPopupShop();
    });

    GEvent.addListener(marker, "popup", function() {

    var myHtml = "<table align='left' id=''><tr><td align='left' width='260px'>" + shopName + "<img src=" + shopLogo + " height='80px' width='100px' hspace='5' align='left'></img><br/>" + shopMessage + "</td></tr><tr valign='top'><td valign='top' align='left'></td></tr><tr><td><a href = '/City/Trademark/" + marker.value + "?CityID=" + shopCity + "&CategoryID=" + shopCategory + "&Lat=" + lat + "&Lng=" + lng + "'>更多详细信息</a></td></tr></table>";
   
        map.openInfoWindowHtml(latlng, myHtml);

    });

    GEvent.addListener(marker, "infowindowclose", function() {
        startPopupShop();
    });

    GEvent.addListener(marker, "mouseover", function() {
        stopPopupShop();
    });

    shopList.push(marker);
    return marker;
}

function getShop() {
    //alert('testGetShop');
    var bound = map.getBounds();

    var northEast = bound.getNorthEast();
    var southWest = bound.getSouthWest();

    var param = "/Home/GetShop/" + northEast.lat() + "," + northEast.lng() + "," + southWest.lat() + "," + southWest.lng(); //alert(param);
    $.getJSON(param, { t: new Date() }, function(j) {
        //alert(j);

        var arr = new Array();

        for (var i = 0; i < j.length; i++) {
            var value = j[i];
            arr = value.split('|');
            // alert(arr);
            var lat = arr[0];
            var lng = arr[1];

            var shopID = arr[2];
            var shopLogo = arr[3];
            var shopMessage = arr[4].substring(0, 100);
            var shopDescription = shopMessage + '...';
            var shopType = arr[5];
            var shopName = arr[6];
            var shopCity = arr[7];
            var shopCategory = arr[8];
            //alert(shopCity);
            if (lat != 0.000 && lng != 0.000) {
                var marker = createShop(new GLatLng(lat, lng), shopDescription, shopID, shopLogo, shopType, shopName, shopCity, shopCategory, lat, lng);
            }

        }

    });
}



function getIcon(type) {

    var icon = new GIcon();
    icon.image = "../../Content/img/shopType/"
		+ type + ".gif";
    icon.iconAnchor = new GPoint(16, 16);
    icon.infoWindowAnchor = new GPoint(16, 0);
    icon.iconSize = new GSize(16, 16);
    //    icon.shadow = "../../Content/img/shopType/"
    //		+ type + "-shadow.jpg";
    //   icon.shadowSize = new GSize(59, 32);

    return icon;
}


function startPopupShop() {
    stopPopupFlag = false;
    popupNum = 0;
    loopPopupShop();
}

function stopPopupShop() {
    stopPopupFlag = true;
}

function resumePopupShop() {
    stopPopupFlag = false;
    popupNum = 0;
    loopPopupShop();
}

function loopPopupShop() {
    window.setTimeout(function() {
        if (stopPopupFlag == true) {
            stopPopupFlag = false;
            return;
        }
        var currentMarker = shopList[popupNum];
        GEvent.trigger(currentMarker, "popup");

        popupNum += 1;

        if (popupNum >= shopList.length)
            popupNum = 0;

        loopPopupShop();
    }

    , 6000);
}

function getCityMark(id) {

    var FlashID = id.split('c');
    //alert(FlashID[1]);
    var param = "/Home/GetCityMark/" + FlashID[1];
    var num;
    $.getJSON(param, { t: new Date() }, function(j) {

        var arr = new Array();

        for (var i = 0; i < j.length; i++) {
            var value = j[i];
            arr = value.split('|');

            var lat = arr[0];
            var lng = arr[1];
            
            var shopID = arr[2];
            var shopLogo = arr[3];
            var shopMessage = arr[4];
            var shopType = arr[5];
            var marker = createCityMark(new GLatLng(lat,lng), shopMessage, shopID, shopLogo, shopType);


        }

    });
}
function createCityMark(latlng, shopMessage, shopID, shopLogo, shopType) {
    //alert(latlng);
    var marker = new GMarker(latlng, { icon: getIcon(shopType) });
    marker.value = shopID;

    markerManager.addMarker(marker, 1);
    markerManager.refresh();

    GEvent.addListener(marker, "click", function() {
    var myHtml = "<table align='left' id=''><tr><td align='left' width='260px'><img src=" + shopLogo + " height='80px' width='100px' hspace='5' align='left'>" + "</img>" + shopMessage + "</td></tr><tr><td><a href = '/City/Trademark/" + marker.value + "'>更多详细信息</a></td></tr></table>";
        map.openInfoWindowHtml(latlng, myHtml);
        stopPopupShop();
    });

    GEvent.addListener(marker, "popup", function() {
    var myHtml = "<table align='left' id=''><tr><td align='left' width='260px'><img src=" + shopLogo + " height='80px' width='100px' hspace='5' align='left'>" + "</img>" + shopMessage + "</td></tr><tr><td><a href = '/City/Trademark/" + marker.value + "'>更多详细信息</a></td></tr></table>";
        map.openInfoWindowHtml(latlng, myHtml);
        stopPopupShop();

    });

    GEvent.addListener(marker, "infowindowclose", function() {
        startPopupShop();
    });

    GEvent.addListener(marker, "mouseover", function() {
        stopPopupShop();
    });
    var total = shopList.length;
    shopList.push(marker);
    var currentMarker = shopList[total];
    GEvent.trigger(currentMarker, "popup");
    return marker;
}

//得到热点商户信息
function getSearchRaking() {
//通过JSON来得到热点商户的信息
$.getJSON('/Home/getTopSearch', { t: new Date() }, function(j) {
//对是否有信息做判断
    if (j[0] == null || j[0] == "" | j[0] == " ") {
        var tr1 = document.getElementById("MoreCity").insertRow();

        var td1 = tr1.insertCell();

        td1.width = "20%";

        td1.align = "center";

        td1.innerHTML = "暂无内容";
    } else {

        var arr = new Array();
        var s = null;

        var tabNum;
        var arr;
        var march = '4';

        var num = '0';
        //通过连个循环来对查询出的数据进行相应的排版
        for (var i = 0; i < 2; i++) {

            var tr1 = document.getElementById("MoreCity").insertRow();


            for (var b = 0; b < j.length; b++) {

                if (b == 4) {
                
                    break;
                }
                //得到我们需要的相应的数据
                var value = j[b];
                arr = value.split('|');
                //得到SHOPID
                var shopID = arr[0];
                //得到SHOPNAME
                var shopName = arr[1];
                //得到SHOP所在的城市ID
                var shopCityID = arr[2];
                //得到SHOP所对应的CATEGORYID
                var shopCategory = arr[3];
                //得到SHOP的经纬度
                var shopLat = arr[4];
                var shopLng = arr[5];

                var td1 = tr1.insertCell();

                td1.width = "20%";

                td1.align = "center";
                //在TD中把相应的数据展示出来
                td1.innerHTML = "<a class='morecity' href='/City/Trademark/' " + shopID + "'?CityID='" + cityID + "'&CategoryID='" + category + "'&Lat='" + lat + "'&Lng='" + shopLng + " style='text-decoration:none; color:#505ABC' >" + shopName + "</a>";


            } //FOR结束

        } //ELSE结束
    }

})
}


//FLASH上的查询功能实现

function getFlashSearch() {
  //  alert('testgetFlashSearch');
//得到用户输入的城市名
    var cityName = document.getElementById("tb_search").value;
    //alert(cityName);
    //判断用户输入的是否为空或是不符合要求的,如果是的话就对用户进行提示
    if (cityName == null || cityName == " " || cityName == "" || cityName == '请输入浏览的城市') {
    
        alert('请输入您要查找的城市!');
        return false;

    } else {
    
        //根据用户输入的城市名来判断是否有这些城市的存在
        if (cityName == '札幌') {
            window.location.href = '/City/CityDetail/1';
        } else if (cityName == '小樽') {
            window.location.href = '/City/CityDetail/2';
        } else if (cityName == '网走') {
            window.location.href = '/City/CityDetail/6';
        } else if (cityName == '钏路') {
            window.location.href = '/City/CityDetail/7';
        } else if (cityName == '函馆') {
            window.location.href = '/City/CityDetail/8';
        } else if (cityName == '新潟') {
            window.location.href = '/City/CityDetail/11';
        } else if (cityName == '长野') {
            window.location.href = '/City/CityDetail/12';
        } else if (cityName == '山梨') {
            window.location.href = '/City/CityDetail/13';
        } else if (cityName == '富山') {
            window.location.href = '/City/CityDetail/14';
        } else if (cityName == '石川') {
            window.location.href = '/City/CityDetail/15';
        } else if (cityName == '福井') {
            window.location.href = '/City/CityDetail/16';
        } else if (cityName == '静冈') {
            window.location.href = '/City/CityDetail/17';
        } else if (cityName == '爱知') {
            window.location.href = '/City/CityDetail/18';
        } else if (cityName == '岐阜') {
            window.location.href = '/City/CityDetail/19';
        } else if (cityName == '秋田') {
            window.location.href = '/City/CityDetail/21';
        } else if (cityName == '岩手') {
            window.location.href = '/City/CityDetail/22';
        } else if (cityName == '山形') {
            window.location.href = '/City/CityDetail/23';
        } else if (cityName == '宫城') {
            window.location.href = '/City/CityDetail/24';
        } else if (cityName == '福岛') {
            window.location.href = '/City/CityDetail/25';
        } else if (cityName == '东京') {
            window.location.href = '../../City/CityDetail/26';
            //document.getElementById("searchButton").action = '/City/CityDetail/26';
        } else if (cityName == '神奈川') {
            window.location.href = '/City/CityDetail/27';
        } else if (cityName == '千叶') {
            window.location.href = '/City/CityDetail/28';
        } else if (cityName == '埼玉') {
            window.location.href = '/City/CityDetail/29';
        } else if (cityName == '茨城') {
            window.location.href = '/City/CityDetail/30';
        } else if (cityName == '枥木') {
            window.location.href = '/City/CityDetail/31';
        } else if (cityName == '群马') {
            window.location.href = '/City/CityDetail/32';
        } else if (cityName == '大阪') {
            window.location.href = '/City/CityDetail/33';
        } else if (cityName == '京都') {
            window.location.href = '/City/CityDetail/34';
        } else if (cityName == '兵库') {
            window.location.href = '/City/CityDetail/35';
        } else if (cityName == '奈良') {
            window.location.href = '/City/CityDetail/36';
        } else if (cityName == '和歌山') {
            window.location.href = '/City/CityDetail/37';
        } else if (cityName == '三重') {
            window.location.href = '/City/CityDetail/38';
        } else if (cityName == '滋贺') {
            window.location.href = '/City/CityDetail/39';
        } else if (cityName == '广岛') {
            window.location.href = '/City/CityDetail/40';
        } else if (cityName == '冈山') {
            window.location.href = '/City/CityDetail/42';
        } else if (cityName == '香川') {
            window.location.href = '/City/CityDetail/45';
        } else if (cityName == '爱媛') {
            window.location.href = '/City/CityDetail/47';
        } else if (cityName == '福冈') {
            window.location.href = '/City/CityDetail/49';
        } else if (cityName == '长崎') {
            window.location.href = '/City/CityDetail/51';
        } else if (cityName == '熊本') {
            window.location.href = '/City/CityDetail/52';
        } else if (cityName == '大分') {
            window.location.href = '/City/CityDetail/53';
        } else if (cityName == '宫崎') {
            window.location.href = '/City/CityDetail/54';
        } else if (cityName == '鹿儿岛') {
            window.location.href = '/City/CityDetail/55';
        } else if (cityName == '那霸') {
            window.location.href = '/City/CityDetail/56';
        } else if (cityName == '冲绳中部') {
            window.location.href = '/City/CityDetail/58';
        } else {
            alert('很抱歉，目前本站暂没有收录您想去的城市！');
            return false;
        }

    }

}

function changeCityName(cityName) {
   
}

//默认的查询

function initMenu() {
    //通过JSON来对此出的数据进行查询
    //alert('test0');
    $.getJSON('/Home/indexHotTrademark/1', { t: new Date() }, function(j) {

        var arr = new Array();
        var s = null;
        //alert(j[0]);
        //判断查询出的是否有数据
        if (j[0] != 'nothing') {

            document.getElementById("nothingMessageTrademark").style["visibility"] = "hidden";
            document.getElementById("Table1").style["visibility"] = "visible";
            //通过FOR循环来得到不同的值
            for (var i = 0; i < j.length; i++) {
                //得到数据后对数据进行分割
                var value = j[i];
                arr = value.split('★');
                //得到shopid
                var shopID = arr[0];
                //得到shopName
                var shopName = arr[1];
                //得到shop经纬度
                var lat = arr[2];
                var lng = arr[3];
                //得到shop所在城市
                var shopCityID = arr[4];
                //得到shop的CATEGORYID
                var shopCategoryID = arr[5];
                //组合连接路径
                var rel = "/City/Trademark/" + shopID + "?CityID=" + shopCityID + "&CategoryID=" + shopCategoryID + "&Lat=" + lat + "&Lng=" + lng;
                //给相关的标签赋值
                $("#hotTrademark" + (i + 1)).attr("href", rel);
                document.getElementById("sp_hotTrademark" + (i + 1)).innerHTML = shopName;
                document.getElementById("sp_hotTrademark" + (i + 1)).style["visibility"] = "visible";
                document.getElementById("hotTrademark" + (i + 1)).style["visibility"] = "visible";

                document.getElementById("hotSearchRankingMessage").style["visibility"] = "hidden";
                document.getElementById("junketinglinks").style["visibility"] = "hidden";
                //document.getElementById("links3").style["visibility"] = "hidden";
                



            }
        } else {

            document.getElementById("nothingMessageTrademark").style["visibility"] = "visible";
            document.getElementById("Table1").style["visibility"] = "hidden";
            document.getElementById("nothingMessageTrademark").innerHTML = '暂无任何信息!';

        }
    })
}

//当点击热门商户这个TAB的时候调用的方法
function ClickMenu001() {

    $('#aMenu001').click(function() {
    //alert('test1');
        //通过JSON来对此出的数据进行查询
        $.getJSON('/Home/indexHotTrademark/1', { t: new Date() }, function(j) {

            var arr = new Array();
            var s = null;
            //判断查询出的是否有数据
            if (j[0] != 'nothing') {
                
                document.getElementById("nothingMessageTrademark").style["visibility"] = "hidden";
                document.getElementById("Table1").style["visibility"] = "visible";
                //通过FOR循环来得到不同的值
                for (var i = 0; i < j.length; i++) {
                    //得到数据后对数据进行分割
                    var value = j[i];
                    arr = value.split('★');
                    //得到shopid
                    var shopID = arr[0];
                    //得到shopName
                    var shopName = arr[1];
                    //得到shop经纬度
                    var lat = arr[2];
                    var lng = arr[3];
                    //得到shop所在城市
                    var shopCityID = arr[4];
                    //得到shop的CATEGORYID
                    var shopCategoryID = arr[5];
                    //组合连接路径
                    var rel = "/City/Trademark/" + shopID + "?CityID=" + shopCityID + "&CategoryID=" + shopCategoryID + "&Lat=" + lat + "&Lng=" + lng;
                    //给相关的标签赋值
                    $("#hotTrademark" + (i + 1)).attr("href", rel);
                    document.getElementById("sp_hotTrademark" + (i + 1)).innerHTML = shopName;
                    document.getElementById("sp_hotTrademark" + (i + 1)).style["visibility"] = "visible";
                    document.getElementById("hotTrademark" + (i + 1)).style["visibility"] = "visible";

                    document.getElementById("hotSearchRankingMessage").style["visibility"] = "hidden";
                    document.getElementById("junketinglinks").style["visibility"] = "hidden";
                    //document.getElementById("links3").style["visibility"] = "hidden";



                }
            } else {
           
                document.getElementById("nothingMessageTrademark").style["visibility"] = "visible";
                document.getElementById("Table1").style["visibility"] = "hidden";
                document.getElementById("nothingMessageTrademark").innerHTML = '暂无任何信息!';

            }
        })


    })
}
//当点击第二个TAB的时候调用的方法
function ClickMenu002() {
    $('#aMenu002').click(function() {
        //通过JSON来对此出的数据进行查询
        //alert('test2');
        $.getJSON('/Home/hotSearchRanking/3', { t: new Date() }, function(j) {
            var arr = new Array();
            var s = null;
            //判断查询出的是否有数据
            if (j[0] != 'nothing') {
                document.getElementById("hotSearchRankingMessage").style["visibility"] = "hidden";
                document.getElementById("junketinglinks").style["visibility"] = "visible";
                //通过FOR循环来得到不同的值
                for (var i = 0; i < j.length; i++) {
                    //得到相关查询关键字
                    var value = j[i];
                  //  alert(value);
                    //组合连接路径
                     //var rel = "/City/CityDetail/" + shopID + "?CityID=" + shopCityID + "&CategoryID=" + shopCategoryID + "&Lat=" + lat + "&Lng=" + lng;
                    //给相关的标签赋值
                    //$("#hotSearchRanking" + (i + 1)).attr("href", rel);
                    document.getElementById("sp_hotSearchRanking" + (i + 1)).innerHTML = value;
                    document.getElementById("sp_hotSearchRanking" + (i + 1)).style["visibility"] = "visible";

                    document.getElementById("Table1").style["visibility"] = "hidden";
                    document.getElementById("nothingMessageTrademark").style["visibility"] = "hidden";
                    //document.getElementById("links3").style["visibility"] = "hidden";
                    
                    


                }
            } else {
               // alert(j[0]);
                document.getElementById("hotSearchRankingMessage").style["visibility"] = "visible";
                document.getElementById("junketinglinks").style["visibility"] = "hidden";
                document.getElementById("hotSearchRankingMessage").innerHTML = '暂无任何信息!';

            }

        })

    })
}


//点击首页热门关键字连接
function hotSearchRanking(id) {
    //var s = document.getElementById("sp_hotSearchRanking").innerHTML;
    

    var s = document.getElementById("sp_hotSearchRanking" + id).innerHTML;
    $.getJSON('/Home/getTrademarkSearchButton/' + s, { t: new Date() }, function(j) {
        //得到查询后的值
        var value = j[0];

        //如果查询后的值为YES的话,进行跳转页面操作
        if (value == 'ok') {
            
            window.location.href('/Home/SearchMessage');
        }
    })

}

//视频弹出
function videopage(g) {
    var s = document.getElementById("test_sp"+g).innerHTML;
    window.navigate('/home/Video/' + s);
}

//本地视频
function videopage1(h) {
    var s = document.getElementById("test_sp" + h).innerHTML;
    window.navigate('/home/Video/' + s );
}

